Skip to content

Add useragent for service and version #6212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 1, 2025

Conversation

RanVaknin
Copy link
Contributor

@RanVaknin RanVaknin commented Jun 25, 2025

Motivation and Context

Implements User Agent 2.1 SEP by adding service-specific API metadata to user agent strings.

Example:

// user agent now includes the service identifier and the version with which the request was sent from:
"aws-sdk-java/2.26.22-SNAPSHOT ua/2.1 api/DynamoDB#2.26.22-SNAPSHOT os/Mac_OS_X#14.6.1 lang/java#21.0.2 md/OpenJDK_64-Bit_Server_VM#21.0.2+13-LTS md/en_US"

Modifications

  • Added a new constant USER_AGENT in ServiceVersionInfo to carry the service id + version.
  • Modified client constructors to include API metadata in user agent
  • Modified SdkUserAgentBuilder to include API metadata in correct position
  • Added unit tests for user agent format validation, and order validation (following the SEP)

Testing

  • Added fixture tests for useragent constant code generation
  • Added user agent builder tests with API metadata scenarios

@RanVaknin RanVaknin requested a review from a team as a code owner June 25, 2025 22:12
@RanVaknin RanVaknin changed the title Rvaknin/add useragent for service Add useragent for service and version Jun 25, 2025
Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm out of office the rest of the day - approving so I dont block this - pending resolution of:

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
78.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@RanVaknin RanVaknin added this pull request to the merge queue Jul 1, 2025
Merged via the queue into master with commit eb4c3a2 Jul 1, 2025
33 of 35 checks passed
Copy link

github-actions bot commented Jul 1, 2025

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants